import { defineEventHandler, readBody } from 'h3';

export default defineEventHandler(async (event) => {
  const body = await readBody(event);
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  const { input, context: _context } = body;

  // 模拟入住行为执行
  const result = {
    status: 'completed' as const,
    output: {
      checkInId: `checkin_${Date.now()}`,
      status: 'checked_in',
      roomKey: `key_${Math.random().toString(36).slice(2, 10)}`,
      checkInTime: new Date().toISOString(),
    },
    eventIds: [`evt_${Date.now()}`],
    state: 'occupied',
  };

  return {
    code: 0,
    data: result,
    message: '入住行为执行成功',
  };
});
